﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LikeTry.Logic;

namespace LikeTry
{
    public partial class Logon : System.Web.UI.Page
    {
      

        protected void Logonbtn_Click(object sender, EventArgs e)
        {
            var result = UserOper.Logon(this.txtEmail.Text.Trim(), this.txtPwd.Text.Trim());
            if (result)
            {
                Session["UserName"] = this.txtEmail.Text.Trim();
                Response.Redirect("Default.aspx");
            }
            else
            {
                this.RegisterClientScriptBlock("invalidCode", "<script>alert('登录失败！')</script>");
            }
        }
    }
}